-
Notifications
You must be signed in to change notification settings - Fork 379
chore: update repo to use ic-agent 0.45 and resolve conflicts from cargo update #8816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This commit fixes all compilation errors introduced by running cargo update, which updated several dependencies to newer versions with breaking API changes. Key fixes: - Pin proptest to =1.6.0 to avoid rand version conflicts - Update slog_o! macro to slog::o!() (deprecated) - Update assert_cmd Command::cargo_bin() to cargo_bin_cmd! macro - Fix ic-agent API changes (BasicIdentity::from_pem, AgentError::TransportError, HttpService trait) - Update wirm Instructions::new() and Module::parse() signatures - Add nix feature flags for process and signal - Update ic-utils deprecated types (InstallMode, CanisterStatus, take_canister_snapshot) - Add missing dependencies (bytes, http, ic-management-canister-types) - Fix version conflicts (ic-utils pinned version in nns-system-tests) Total files modified: 28 files across 9 different dependency updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):
-
Update
unreleased_changelog.md(if there are behavior changes, even if they are
non-breaking). -
Are there BREAKING changes?
-
Is a data migration needed?
-
Security review?
How to Satisfy This Automatic Review
-
Go to the bottom of the pull request page.
-
Look for where it says this bot is requesting changes.
-
Click the three dots to the right.
-
Select "Dismiss review".
-
In the text entry box, respond to each of the numbered items in the previous
section, declare one of the following:
-
Done.
-
$REASON_WHY_NO_NEED. E.g. for
unreleased_changelog.md, "No
canister behavior changes.", or for item 2, "Existing APIs
behave as before.".
Brief Guide to "Externally Visible" Changes
"Externally visible behavior change" is very often due to some NEW canister API.
Changes to EXISTING APIs are more likely to be "breaking".
If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.
If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.
Reference(s)
For a more comprehensive checklist, see here.
GOVERNANCE_CHECKLIST_REMINDER_DEDUP
The cargo update brought in wirm 2.2.0 in Cargo.lock, but Cargo.toml still specified 2.1.0. This caused Bazel to use the old version while our code was fixed for the new API. Update Cargo.toml to match.
Per discussion, we don't want to update wirm at this time. This commit: - Reverts Cargo.toml wirm version back to 2.1.0 - Reverts all wirm API changes (Instructions::new and Module::parse) - Downgrades Cargo.lock to wirm 2.1.0 Files reverted: - rs/embedders/src/wasm_utils/instrumentation.rs (3 changes) - rs/embedders/src/wasm_utils/system_api_replacements.rs - rs/embedders/src/wasm_utils/validation.rs - rs/embedders/benches/embedders_bench/src/lib.rs - rs/embedders/tests/instrumentation.rs (6 changes) - rs/embedders/tests/misc_tests.rs (2 changes) - rs/embedders/tests/spec_tests.rs - rs/embedders/tests/wirm_round_trip.rs
Update rust.MODULE.bazel to match the dependency versions in Cargo.toml: - ic-agent: ^0.40.1 → ^0.45.0 - ic-utils: ^0.40.1 → ^0.45.0 - ic-identity-hsm: ^0.40.1 → ^0.45.0 - ic-transport-types: ^0.40.1 → ^0.45.0 - dfx-core: ^0.1.4 → ^0.3.0 - ic-bn-lib: 0.1.7 → 0.1.14 - ic-gateway: rev → tag v0.4.0 - ic-http-gateway: rev c17ad1b... → rev 895d573... - proptest: ^1.5.0 → =1.6.0 This ensures Bazel uses the same dependency versions as Cargo.
Regenerated Cargo.Bazel.json.lock and Cargo.Bazel.toml.lock to reflect the updated dependency versions in rust.MODULE.bazel.
Updated Cargo.toml and rust.MODULE.bazel to use tag=v0.4.2 instead of rev to match Cargo.lock. This eliminates the duplicate ic-http-gateway entry that was causing the GitHub dependency submission job to fail.
Updated fqdn from 0.3.11 to 0.5.2 in pocket_ic_server to resolve version conflict with ic-bn-lib 0.1.14, which requires fqdn 0.5.x. This ensures all fqdn dependencies use version 0.5 or higher.
It's annoying for external contributors that CI is automatically kicked off on pushes to master on the forked repos and then fail. This adds another condition to prevent them from being triggered. --------- Co-authored-by: Bas van Dijk <bas@dfinity.org>
…8790) This makes it much easier to locate code that mutates a `CanisterState` (simply grep for the 4 methods that return a `CanisterState` or a mutable reference to one). Which comes in very handy when `CanisterStates` are wrapped in `Arcs`, as mutating (too many of) said `Arcs` may turn out to be very expensive.
…veFromUnvalidated` for some BlockProposal validation failures (#8809) This will make it consistent with the other types of artifacts. See: 1. https://github.com/dfinity/ic/blob/8910873dccbe92b31127d6350cdb90d6bbd50f52/rs/consensus/src/consensus/validator.rs#L911-L915 2. https://github.com/dfinity/ic/blob/8910873dccbe92b31127d6350cdb90d6bbd50f52/rs/consensus/src/consensus/validator.rs#L1477-L1478 3. https://github.com/dfinity/ic/blob/8910873dccbe92b31127d6350cdb90d6bbd50f52/rs/consensus/src/consensus/validator.rs#L1760-L1762
- Updated ic-bn-lib-common version spec in bazel/rust.MODULE.bazel from 0.1 to 0.1.4 - Regenerated Bazel lock files to resolve fqdn version conflicts - Updated test data file with latest Cargo.Bazel.toml.lock snapshot - This ensures all fqdn dependencies use version 0.5.x as required by ic-bn-lib 0.1.14
Summary
This PR fixes all compilation errors introduced by running
cargo update, which updated several dependencies to newer versions with breaking API changes.Changes
1. proptest (pinned to =1.6.0)
2. slog (deprecated macro)
slog_o!macro deprecated in favor ofslog::o!()3. assert_cmd (deprecated API)
Command::cargo_bin()deprecated in favor ofcargo_bin_cmd!macro4. ic-agent (v0.40.1 → v0.45.0)
BasicIdentity::from_pem()now requires bytes directly, not file handles or cursors (4 files)AgentError::TransportErrornow wrapsTransportError::Reqwest(e)(1 file)HttpServicetrait signature changed: addedsize_limitparameter and changed types tohttp::Request<Bytes>(1 file)5. wirm (v2.1.0 → v2.2.0)
Instructions::new()now requires 3 parameters: vec with offset tuples, locals_start, save_offsets (2 files, 4 occurrences)Module::parse()now requires 3 parameters, addedwith_offsets: bool(6 files, 9 occurrences)6. nix (v0.29.0)
Pidandkillnow require feature flagsfeatures = ["process", "signal"]to pocket_ic_server/Cargo.toml7. ic-utils (v0.40.1 → v0.45.0)
InstallModedeprecated → useCanisterInstallMode(2 files)CanisterStatusdeprecated → useCanisterStatusType(1 file)take_canister_snapshot()signature changed, requires public crate types (1 file)8. Missing dependencies
bytesandhttpto boundary_nodes tests Cargo.tomlic-management-canister-typesto consensus upgrade tests9. Version conflicts
ic-utils = "0.40.1"pinned → changed to{ workspace = true }Test Plan
All changes fix compilation errors. The code should build successfully after these changes.
Files Changed
Total: 28 files modified